﻿using System;

namespace InterfaceLiftLib.Models
{
    public sealed class Resolution : IComparable<Resolution>
    {
        public uint X { get; private set; }

        public uint Y { get; private set; }

        public Resolution(uint x, uint y)
        {
            this.X = x;
            this.Y = y;
        }

        public int CompareTo(Resolution other)
        {
            var thisTotal = X * Y;
            var otherTotal = other.X * other.Y;

            if (thisTotal > otherTotal) return -1;
            if (thisTotal == otherTotal) return 0;
            return 1;
        }

        public override string ToString()
        {
            return X + "x" + Y;
        }
    }
}
